<%--
  Created by IntelliJ IDEA.
  User: HP
  Date: 2020/7/7
  Time: 16:30
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java"  isELIgnored="true" %>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<html>
<head>
    <title>Title</title>
</head>
<%@include file="/common/com.jsp"%>
<body>
<div id="root">
    <card>
        <i-button type="dashed" shape="circle" @click="getCustomerList()"><Icon type="ios-refresh"></Icon>刷新</i-button>
        <i-button type="dashed" @click="add">添加</i-button>
    </card>

    <i-table :columns="columns" :data="data" border stripe height="400">
        <template slot-scope="{row,index}" slot="action">
            <i-Button type="dashed" @click="update(row,index)">修改</i-Button>
            <i-Button type="dashed" @click="del(row,index)">删除</i-Button>
        </template>
    </i-table>


    <template>
        <Page :total="total"
              show-elevator
              :page-size="pageSize"
              style="margin-left: 340px;margin-top:15px"
              :current.sync="pageNo"
              show-sizer
              prev-text="上一页"
              next-text="下一页"
              :page-size-opts="[5,10,20,30,40]"
              show-total
              @on-page-size-change="getcustomerList();"
              @on-change="getcustomerList"/>
    </template>


</div>

</body>
<script>
    new  Vue({
        el:"#root",
        data:{
            columns:[
                {title:"客户名称",key:"customerName"},
                {title:"归属",key:"customerAscription"},
                {title:"上次联系时间",key:"customerLastContact"},
                {title:"联系内容",key:"customerContent"},
                {title:"下次内容",key:"customerNextContact"},
                {title:"创建时间",key:"customerCreationTime"},
                {title:"其他操作",slot:"action"}
            ],
            data:[],
            customerList:[],
            total:50,
            pageNo:1,
            pageSize:5,
            modaladd:false,
            modalupdate:false,
            modaladdissue:false,
            customer:{},


        },
        mounted(){
            this.getcustomerList();
        },
        methods:{
            getcustomerList(){
                axios.get(`${apath}/customer/pagelist/${this.pageSize}/${this.pageNo}`,{params:this.customer})
                    .then(({data})=>{
                        console.log(data.result);
                        this.data=data.result.record;
                        this.total=data.result.total;
                    })
            },




        }
    })
</script>
</html>
